/** 用户登录状态管理 */
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    token: '',
    mobile: ''
  },
  mutations: {
    set_user (state, user) {
      state.mobile = user.phone
      console.log(user.phone + user.password)
      localStorage.setItem('currentUser_name', user.phone)
      localStorage.setItem('currentUser_token', user.password)
    },
    set_token (state, token) {
      console.log('this is my ' + token)
    },
    del_token () {

    },
    getuser (state) {
      console.log(state.mobile)
    }
  }
})
